<?php
use yii\helpers\Html;
$userservice=\myVendor\Factorys::getUserService();
$login_user_name=$userservice->getLoginUser();

$ParamService=new \srvs\ParamService();
$base_info=$ParamService->getBaseInfo();
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= $base_info["webtitle"] ?></title>
    <meta http-equiv="keywords" content="<?= $base_info["keywords"] ?>" />
    <meta http-equiv="description" content="<?= $base_info["description"] ?>" />
    <link href="/css/bootstrap.css" rel="stylesheet">
    <link href="/css/jquery-ui.min.css" rel="stylesheet">
    <link href="/css/toastr.min.css" rel="stylesheet">
    <link href="/css/site.css" rel="stylesheet">
    <script src="/js/jquery.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/jquery-ui.min.js"></script>
    <script src="/js/toastr.min.js"></script>
    <script type="text/javascript">
        var tplData = <?=json_encode($this->params['tpldata']);?>||{};
    </script>
    <script src="/js/main.js"></script>
    <?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>
<div class="wrap">

    <nav id="w1" class="navbar-default navbar-static-top navbar mynavbar" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#w1-collapse"><span
                        class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span></button>
                    <?php if (!empty($base_info["weblogo"])) : ?>
                        <a href="/"><img src="<?=$base_info["weblogo"]?>" alt="" style="max-height: 50px;padding-right: 10px"></a>
                    <?php endif; ?>
            </div>
            <div id="w1-collapse" class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li <?= (isset($this->params['top_menu_active_id'])&&$this->params['top_menu_active_id'] == 2) ? 'class="active"' : '' ?>><a href="/admin/param">网站设置</a></li>
                    <li <?= (isset($this->params['top_menu_active_id'])&&$this->params['top_menu_active_id'] == 3) ? 'class="active"' : '' ?>><a href="/admin/company">公司设置</a></li>
                    <li <?= (isset($this->params['top_menu_active_id'])&&$this->params['top_menu_active_id'] == 0) ? 'class="active"' : '' ?>><a href="/admin/menu-edit">栏目设置</a></li>
                    <li <?= (isset($this->params['top_menu_active_id'])&&$this->params['top_menu_active_id'] == 1) ? 'class="active"' : '' ?>><a href="/admin/content-list">内容管理</a></li>
                </ul>
                <ul class="navbar-nav navbar-right nav">
                    <li><a href="/login">后台管理</a></li>
                    <?php if (!empty($login_user_name)) : ?>
                        <li><a href="/login/logout">注销 (<?=$login_user_name?>)</a></li>
                    <?php endif; ?>
                </ul>
            </div>
        </div>
    </nav>

    <div class="container">
        <?= $content ?>
    </div>
</div>

<footer class="footer">
    <div class="container">
        <p class="pull-left">&copy; <?=$base_info["companyname"]?> <?= date('Y') ?></p>
        <p class="pull-right">Powered by <a href="/" rel="external"><?=$base_info["companyname"]?></a></p>
    </div>
</footer>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
